/****************************************************************************
*                                                                           *
* sensorrepository.h														*
*                                                                           *
* ALaRI 2008												                *
*                                                                           *
****************************************************************************/
#pragma once

#if !defined(__SENSORREPOSITORY_H)
#define __SENSORREPOSITORY_H

/****************************************************************************
* Includes										                            *
****************************************************************************/
#include "sensor.h"
#include "../../common/repository.h"
#include "../../common/defs.h"
#include <QList>
#include <list>
#include <QObject>

class CSensorRepository : 
	public QObject,
	public CRepository<CSensorRepository, unsigned int, CSensor*> 
{
	Q_OBJECT

public :
	void init();
	void destroy() { destroyInstance(); }

	static CSensorRepository* inst() 
		{ return dynamic_cast<CSensorRepository*>(getInstance()); } 

	QList<CSensor*> toQList();
	std::list<CSensor*> toStdList();

	QList<QString> getQListNames();

	CSensor* getSensor(unsigned int nSensorID);
	CSensor* getSensor(int nPosX, int nPosY);
	CSensor* getSensor(const QString& strName);

	void addSensor(CSensor *pSensor);
	void removeSensor(int nPosX, int nPosY);

signals:
	void changed();
};

#endif /* __SENSORREPOSITORY_H */
/****************************************************************************
* End of file																*
****************************************************************************/